package service

import (
	"context"
	"userrpc/biz/dal/redis"
	user "userrpc/kitex_gen/user"
)

type RegisterUserService struct {
	ctx context.Context
} // NewRegisterUserService new RegisterUserService
func NewRegisterUserService(ctx context.Context) *RegisterUserService {
	return &RegisterUserService{ctx: ctx}
}

// Run create note info
func (s *RegisterUserService) Run(req *user.User) (resp *user.Response, err error) {
	// Finish your business logic.
	redis.Init()
	val := redis.RedisClient.Get(s.ctx, "hello").Val()
	var msg string
	if val == "" {
		msg = "hello"
	}
	resp = &user.Response{
		Message: &msg,
	}
	return
}
